import request from '@/utils/request'

// 获取考试列表
export function getExamList (data) {
  return request({
    url: '/plant/exam/list',
    params: data
  })
}

// 新增考试
export function addExam (data) {
  return request({
    url: '/plant/exam',
    method: 'post',
    data
  })
}

// 修改考试
export function updateExam (data) {
  return request({
    url: '/plant/exam',
    method: 'put',
    data
  })
}

// 删除考试
export function delExam (examIds) {
  return request({
    url: `/plant/exam/${examIds}`,
    method: 'delete',
  })
}

// 获取考试详情信息
export function getExamDetail (examId) {
  return request({
    url: `/plant/exam/one/${examId}`,
  })
}

// 获取考试成绩详情信息
export function getExamScoreDetail (data) {
  return request({
    url: `/plant/exam/examId`,
    params: data
  })
}

// 获取个人成绩详情信息
export function getPersonScoreDetail (scoreId) {
  return request({
    url: `/plant/score/${scoreId}`,
  })
}

// 修改成绩接口
export function updateScore (data) {
  return request({
    url: `/plant/score`,
    method: 'put',
    data
  })
}